package com.example.util;

public class RegexSnippetUtils {

	public static boolean isCellphone_CN(String cellphone) {
		return cellphone.matches("^1[3456789][0-9]{9}$");
	}

	public static String desensitizeCellphone_CN(String cellphone) {
		return cellphone.replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2");
	}

	public static String desensitizeIdcard_CN(String idcard) {
		return idcard.replaceAll("(?<=\\w{3})\\w(?=\\w{4})", "*");
	}

}
